Contributions
XML Source
<?xml version="1.0"?>
<component name="org.nuxeo.ecm.social.workspace.gadgets.library"
version="1.0">
<extension target="org.nuxeo.opensocial.gadgets.service"
point="gadget">
<internalGadget name="library" disabled="false">
<documentation>
This gadget displays the mini messages of a user, or the mini messages
of the user's network.
The following user preferences can be used to configure it:
- nuxeoTargetContextPath: the path of the document on which to
initialize the document library
- documentLinkBuilder: the codec name to use to generate
documents URLs
How to include the library gadget in a JSF context:
<code>
<div class="gadget-library threeQuarterWidth"></div>
<script type="text/javascript">
jQuery('.gadget-library').openSocialGadget({
baseURL: '#{baseURL}',
language: '#{localeSelector.language}',
gadgetDefs: [
{ specUrl: '#{gadgetsBaseURL}/site/gadgets/library/library.xml',
title: '',
userPrefs: {
nuxeoTargetContextPath: {
value: '#{currentDocument.pathAsString}'
},
documentLinkBuilder: {
value: 'docid'
}
},
displayTitleBar: false,
width: '100%'
}
]
});
</script>
</code>
How to include the library gadget in a WebEngine page:
<code>
<link rel="stylesheet" href="${contextPath}/css/opensocial/light-container-gadgets.css" />
<script type="text/javascript" src="${contextPath}/opensocial/gadgets/js/rpc.js?c=1"></script>
<script type="text/javascript" src="${contextPath}/js/?scripts=jquery.js|opensocial/cookies.js|opensocial/util.js|opensocial/gadgets.js|opensocial/cookiebaseduserprefstore.js|opensocial/jquery.opensocial.gadget.js"></script>
<div class="gadget-library gadgets-gadget-chrome"></div>
<script type="text/javascript">
$('.gadget-library').openSocialGadget({
baseURL: '${contextPath}' + '/',
language: '${Context.locale.language}',
gadgetDefs: [{
specUrl : '${Runtime.getProperty('nuxeo.loopback.url')}/site/gadgets/library/library.xml',
userPrefs: {
nuxeoTargetContextPath: {
value: '${doc.pathAsString}'
},
documentLinkBuilder: {
value: 'docid'
}
},
displayTitleBar: false,
width: '100%'
}]
});
</script>
</code>
</documentation>
<mountPoint>/library</mountPoint>
<directory>library</directory>
<entryPoint>library.xml</entryPoint>
<category>gadget.category.social.workspace.private</category>
<icon>gadget-library.png</icon>
</internalGadget>
</extension>
</component>